﻿using System;
using System.Data;
using MySql.Data.MySqlClient;
using System.Collections.Generic;
using StockTrader.DAL.IDAL;
using StockTrader.DAL.MySQLHelper;
using StockTrader.BusinessService.DataContract;
using StockTrader.DAL.HastcAdapter.FileParser.Structure;
using StockTrader.BusinessService.DataContract.Hastc;

namespace StockTrader.DAL.MySQL
{
    public class StsStocks : IStsStocks
    {
        private MySqlConnection _internalConnection;
        private MySqlTransaction _internalADOTransaction = null;

        public void BeginADOTransaction()
        {
            if (_internalConnection.State != System.Data.ConnectionState.Open)
                _internalConnection.Open();
            _internalADOTransaction = _internalConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
        }
        public void RollBackTransaction()
        {
            _internalADOTransaction.Rollback();
            _internalADOTransaction = null;
        }
        public void CommitADOTransaction()
        {
            _internalADOTransaction.Commit();
            _internalADOTransaction = null;
        }
        public void Open(string connString)
        {
            if (_internalConnection == null)
                _internalConnection = new MySqlConnection(connString);
            if (_internalConnection.State != ConnectionState.Open)
                _internalConnection.Open();
        }
        public void Close()
        {
            if (_internalConnection != null && _internalConnection.State != System.Data.ConnectionState.Closed)
                _internalConnection.Close();
        }

        #region Parameters
        private const string PARM_FROMDATE = "@from";
        private const string PARM_TODATE = "@to";
        private const string PARM_FLOOR_CODE = "@FLOOR_CODE";
        private const string PARM_DATE_NO = "@DATE_NO";
        private const string PARM_TRADING_DATE = "@TRADING_DATE";
        private const string PARM_CURRENT_STATUS = "@CURRENT_STATUS";
        private const string PARM_TIME = "@TIME";
        private const string PARM_TOTAL_TRADE = "@TOTAL_TRADE";
        private const string PARM_TOTAL_STOCK = "@TOTAL_STOCK";
        private const string PARM_TOTAL_QTTY = "@TOTAL_QTTY";
        private const string PARM_TOTAL_VALUE = "@TOTAL_VALUE";
        private const string PARM_ADVANCES = "@ADVANCES";
        private const string PARM_NOCHANGE = "@NOCHANGE";
        private const string PARM_DECLINES = "@DECLINES";
        private const string PARM_PRIOR_MARKET_INDEX = "@PRIOR_MARKET_INDEX";
        private const string PARM_CHG_INDEX = "@CHG_INDEX";
        private const string PARM_PCT_INDEX = "@PCT_INDEX";
        private const string PARM_CURRENT_INDEX = "@CURRENT_INDEX";
        private const string PARM_MARKET_INDEX = "@MARKET_INDEX";
        private const string PARM_SESSION_NO = "@SESSION_NO";
        private const string PARM_PRV_PRIOR_MARKET_INDEX = "@PRV_PRIOR_MARKET_INDEX";
        private const string PARM_AVR_MARKET_INDEX = "@AVR_MARKET_INDEX";
        private const string PARM_AVR_PRIOR_MARKET_INDEX = "@AVR_PRIOR_MARKET_INDEX";
        private const string PARM_AVR_CHG_INDEX = "@AVR_CHG_INDEX";
        private const string PARM_AVR_PCT_INDEX = "@AVR_PCT_INDEX";
        private const string PARM_PT_TOTAL_QTTY = "@PT_TOTAL_QTTY";
        private const string PARM_PT_TOTAL_VALUE = "@PT_TOTAL_VALUE";
        private const string PARM_PT_TOTAL_TRADE = "@PT_TOTAL_TRADE";

        private const string PARM_ORDER_NO = "@ORDER_NO";
        private const string PARM_ORDER_DATE = "@ORDER_DATE";
        private const string PARM_ORDER_TIME = "@ORDER_TIME";
        private const string PARM_MEMBER_ID = "@MEMBER_ID";
        private const string PARM_ACCOUNT_ID = "@ACCOUNT_ID";
        private const string PARM_STOCK_ID = "@STOCK_ID";
        private const string PARM_ORDER_TYPE = "@ORDER_TYPE";
        private const string PARM_PRIORITY = "@PRIORITY";
        private const string PARM_OORB = "@OORB";
        private const string PARM_NORP = "@NORP";
        private const string PARM_NORC = "@NORC";
        private const string PARM_BORE = "@BORE";
        private const string PARM_AORI = "@AORI";
        private const string PARM_SETTLEMENT_TYPE = "@SETTLEMENT_TYPE";
        private const string PARM_DORF = "@DORF";
        private const string PARM_ORDER_QTTY = "@ORDER_QTTY";
        private const string PARM_ORDER_PRICE = "@ORDER_PRICE";
        private const string PARM_STATUS = "@STATUS";
        private const string PARM_QUOTE_PRICE = "@QUOTE_PRICE";
        private const string PARM_QUOTE_TIME = "@QUOTE_TIME";
        private const string PARM_QUOTE_QTTY = "@QUOTE_QTTY";
        private const string PARM_ACCOUNT_NO = "@ACCOUNT_NO";
        private const string PARM_BROKER_ID = "@BROKER_ID";
        private const string PARM_TELEPHONE = "@TELEPHONE";
        private const string PARM_SETTLE_DAY = "@SETTLE_DAY";
        private const string PARM_AORC = "@AORC";
        private const string PARM_YIELDMAT = "@YIELDMAT";
        private const string PARM_CODE_TRADE = "@CODE_TRADE";

        private const string PARM_STOCK_INFO_ID = "@STOCK_INFO_ID";
        private const string PARM_CODE = "@CODE";
        private const string PARM_STOCK_TYPE = "@STOCK_TYPE";
        private const string PARM_TOTAL_LISTING_QTTY = "@TOTAL_LISTING_QTTY";
        private const string PARM_TRADING_UNIT = "@TRADING_UNIT";
        private const string PARM_LISTTING_STATUS = "@LISTTING_STATUS";
        private const string PARM_ADJUST_QTTY = "@ADJUST_QTTY";
        private const string PARM_REFERENCE_STATUS = "@REFERENCE_STATUS";
        private const string PARM_ADJUST_RATE = "@ADJUST_RATE";
        private const string PARM_DIVIDENT_RATE = "@DIVIDENT_RATE";
        private const string PARM_TOTAL_ROOM = "@TOTAL_ROOM";
        private const string PARM_CURRENT_ROOM = "@CURRENT_ROOM";
        private const string PARM_BASIC_PRICE = "@BASIC_PRICE";
        private const string PARM_OPEN_PRICE = "@OPEN_PRICE";
        private const string PARM_CLOSE_PRICE = "@CLOSE_PRICE";
        private const string PARM_CURRENT_PRICE = "@CURRENT_PRICE";
        private const string PARM_CURRENT_QTTY = "@CURRENT_QTTY";
        private const string PARM_HIGHEST_PRICE = "@HIGHEST_PRICE";
        private const string PARM_LOWEST_PRICE = "@LOWEST_PRICE";
        private const string PARM_BEST_OFFER_PRICE = "@BEST_OFFER_PRICE";
        private const string PARM_BEST_BID_PRICE = "@BEST_BID_PRICE";
        private const string PARM_CEILING_PRICE = "@CEILING_PRICE";
        private const string PARM_FLOOR_PRICE = "@FLOOR_PRICE";
        private const string PARM_TOTAL_OFFER_QTTY = "@TOTAL_OFFER_QTTY";
        private const string PARM_TOTAL_BID_QTTY = "@TOTAL_BID_QTTY";
        private const string PARM_BEST_OFFER_QTTY = "@BEST_OFFER_QTTY";
        private const string PARM_BEST_BID_QTTY = "@BEST_BID_QTTY";
        private const string PARM_PRIOR_PRICE = "@PRIOR_PRICE";
        private const string PARM_PRIOR_CLOSE_PRICE = "@PRIOR_CLOSE_PRICE";
        private const string PARM_MATCH_PRICE = "@MATCH_PRICE";
        private const string PARM_MATCH_QTTY = "@MATCH_QTTY";
        private const string PARM_DELETED = "@DELETED";
        private const string PARM_DATE_CREATED = "@DATE_CREATED";
        private const string PARM_DATE_MODIFIED = "@DATE_MODIFIED";
        private const string PARM_MODIFIED_BY = "@MODIFIED_BY";
        private const string PARM_CREATED_BY = "@CREATED_BY";
        private const string PARM_NAME = "@NAME";
        private const string PARM_PARVALUE = "@PARVALUE";
        private const string PARM_MATCH_VALUE = "@MATCH_VALUE";
        private const string PARM_IS_CALCINDEX = "@IS_CALCINDEX";
        private const string PARM_IS_DETERMINECL = "@IS_DETERMINECL";
        private const string PARM_OFFER_COUNT = "@OFFER_COUNT";
        private const string PARM_BID_COUNT = "@BID_COUNT";
        private const string PARM_AVERAGE_PRICE = "@AVERAGE_PRICE";
        private const string PARM_INDEX_PRICE = "@INDEX_PRICE";
        private const string PARM_PREV_PRIOR_PRICE = "@PREV_PRIOR_PRICE";
        private const string PARM_PREV_PRIOR_CLOSE_PRICE = "@PREV_PRIOR_CLOSE_PRICE";
        private const string PARM_NM_TOTAL_TRADED_QTTY = "@NM_TOTAL_TRADED_QTTY";
        private const string PARM_NM_TOTAL_TRADED_VALUE = "@NM_TOTAL_TRADED_VALUE";
        private const string PARM_PT_MATCH_QTTY = "@PT_MATCH_QTTY";
        private const string PARM_PT_MATCH_PRICE = "@PT_MATCH_PRICE";
        private const string PARM_PT_TOTAL_TRADED_QTTY = "@PT_TOTAL_TRADED_QTTY";
        private const string PARM_PT_TOTAL_TRADED_VALUE = "@PT_TOTAL_TRADED_VALUE";
        private const string PARM_TOTAL_BUY_TRADING_QTTY = "@TOTAL_BUY_TRADING_QTTY";
        private const string PARM_BUY_COUNT = "@BUY_COUNT";
        private const string PARM_TOTAL_BUY_TRADING_VALUE = "@TOTAL_BUY_TRADING_VALUE";
        private const string PARM_TOTAL_SELL_TRADING_QTTY = "@TOTAL_SELL_TRADING_QTTY";
        private const string PARM_SELL_COUNT = "@SELL_COUNT";
        private const string PARM_TOTAL_SELL_TRADING_VALUE = "@TOTAL_SELL_TRADING_VALUE";
        private const string PARM_TOTAL_TRADING_QTTY = "@TOTAL_TRADING_QTTY";
        private const string PARM_TOTAL_TRADING_VALUE = "@TOTAL_TRADING_VALUE";
        private const string PARM_BUY_FOREIGN_QTTY = "@BUY_FOREIGN_QTTY";
        private const string PARM_BUY_FOREIGN_VALUE = "@BUY_FOREIGN_VALUE";
        private const string PARM_SELL_FOREIGN_QTTY = "@SELL_FOREIGN_QTTY";
        private const string PARM_SELL_FOREIGN_VALUE = "@SELL_FOREIGN_VALUE";
        private const string PARM_REMAIN_FOREIGN_QTTY = "@REMAIN_FOREIGN_QTTY";
        private const string PARM_PT_YIELDMAT = "@PT_YIELDMAT";

        private const string PARM_B_ORD_QTTY_3 = "@B_ORD_QTTY_3";
        private const string PARM_B_ORD_PRICE_3 = "@B_ORD_PRICE_3";
        private const string PARM_B_ORD_QTTY_2 = "@B_ORD_QTTY_2";
        private const string PARM_B_ORD_PRICE_2 = "@B_ORD_PRICE_2";
        private const string PARM_B_ORD_QTTY_1 = "@B_ORD_QTTY_1";
        private const string PARM_B_ORD_PRICE_1 = "@B_ORD_PRICE_1";
        private const string PARM_S_ORD_PRICE_1 = "@S_ORD_PRICE_1";
        private const string PARM_S_ORD_QTTY_1 = "@S_ORD_QTTY_1";
        private const string PARM_S_ORD_PRICE_2 = "@S_ORD_PRICE_2";
        private const string PARM_S_ORD_QTTY_2 = "@S_ORD_QTTY_2";
        private const string PARM_S_ORD_PRICE_3 = "@S_ORD_PRICE_3";
        private const string PARM_S_ORD_QTTY_3 = "@S_ORD_QTTY_3";

        private const string PARM_CONFIRM_NO = "@CONFIRM_NO";
        private const string PARM_B_ORDER_NO = "@B_ORDER_NO";
        private const string PARM_B_ORDER_DATE = "@B_ORDER_DATE";
        private const string PARM_S_ORDER_NO = "@S_ORDER_NO";
        private const string PARM_S_ORDER_DATE = "@S_ORDER_DATE";
        private const string PARM_B_NEXT_CNFRM = "@B_NEXT_CNFRM";
        private const string PARM_S_NEXT_CNFRM = "@S_NEXT_CNFRM";
        private const string PARM_MATCH_TIME = "@MATCH_TIME";
        private const string PARM_MATCH_DATE = "@MATCH_DATE";
        private const string PARM_B_TRADING_ID = "@B_TRADING_ID";
        private const string PARM_S_TRADING_ID = "@S_TRADING_ID";
        private const string PARM_B_CODE_TRADE = "@B_CODE_TRADE";
        private const string PARM_S_CODE_TRADE = "@S_CODE_TRADE";
        private const string PARM_SEC_CODE = "@SEC_CODE";
        private const string PARM_QUANTITY = "@QUANTITY";
        private const string PARM_PRICE = "@PRICE";
        private const string PARM_B_ACCOUNT_NO = "@B_ACCOUNT_NO";
        private const string PARM_S_ACCOUNT_NO = "@S_ACCOUNT_NO";
        private const string PARM_SETT_TYPE = "@SETT_TYPE";
        private const string PARM_SETT_DATE = "@SETT_DATE";
        private const string PARM_B_PC_FLAG = "@B_PC_FLAG";
        private const string PARM_S_PC_FLAG = "@S_PC_FLAG";

        private const string PARM_ORDER_QTTY_SELL = "@ORDER_QTTY_SELL";
        private const string PARM_ORDER_PRICE_SELL = "@ORDER_PRICE_SELL";
        private const string PARM_YIELDMAT_SELL = "@YIELDMAT_SELL";
        private const string PARM_ORDER_QTTY_BUY = "@ORDER_QTTY_BUY";
        private const string PARM_ORDER_PRICE_BUY = "@ORDER_PRICE_BUY";
        private const string PARM_YIELDMAT_BUY = "@YIELDMAT_BUY";

        #endregion

        #region QueryStr

        private static string Insert_STS_LE = "INSERT INTO STS_LE(TIME, CODE, STOCK_ID, PRICE, QUANTITY, HIGHEST_PRICE, LOWEST_PRICE, TOTAL_TRADING_QTTY) VALUES (@TIME, @CODE, @STOCK_ID, @PRICE, @QUANTITY, @HIGHEST_PRICE, @LOWEST_PRICE, @TOTAL_TRADING_QTTY) ON DUPLICATE KEY UPDATE TIME=@TIME, CODE=@CODE, STOCK_ID=@STOCK_ID, PRICE=@PRICE, QUANTITY=@QUANTITY, HIGHEST_PRICE=@HIGHEST_PRICE, LOWEST_PRICE=@LOWEST_PRICE, TOTAL_TRADING_QTTY=@TOTAL_TRADING_QTTY;";

        private static string Insert_STS_MARKETINFO = "INSERT INTO STS_MARKETINFO                          (FLOOR_CODE, DATE_NO, TRADING_DATE, CURRENT_STATUS, TIME, TOTAL_TRADE, TOTAL_STOCK, TOTAL_QTTY, TOTAL_VALUE, ADVANCES, NOCHANGE, DECLINES, PRIOR_MARKET_INDEX, CHG_INDEX, PCT_INDEX, CURRENT_INDEX, MARKET_INDEX, SESSION_NO, PRV_PRIOR_MARKET_INDEX, AVR_MARKET_INDEX,AVR_PRIOR_MARKET_INDEX, AVR_CHG_INDEX, AVR_PCT_INDEX, PT_TOTAL_QTTY, PT_TOTAL_VALUE, PT_TOTAL_TRADE) VALUES( @FLOOR_CODE,@DATE_NO,@TRADING_DATE,@CURRENT_STATUS,@TIME,@TOTAL_TRADE,@TOTAL_STOCK,@TOTAL_QTTY,@TOTAL_VALUE,@ADVANCES,@NOCHANGE,@DECLINES,@PRIOR_MARKET_INDEX,@CHG_INDEX,@PCT_INDEX,@CURRENT_INDEX,@MARKET_INDEX,@SESSION_NO,@PRV_PRIOR_MARKET_INDEX,@AVR_MARKET_INDEX,@AVR_PRIOR_MARKET_INDEX,@AVR_CHG_INDEX,@AVR_PCT_INDEX,@PT_TOTAL_QTTY,@PT_TOTAL_VALUE,@PT_TOTAL_TRADE) ON DUPLICATE KEY UPDATE FLOOR_CODE=@FLOOR_CODE,DATE_NO=@DATE_NO,TRADING_DATE=@TRADING_DATE,CURRENT_STATUS=@CURRENT_STATUS,TIME=@TIME,TOTAL_TRADE=@TOTAL_TRADE,TOTAL_STOCK=@TOTAL_STOCK,TOTAL_QTTY=@TOTAL_QTTY,TOTAL_VALUE=@TOTAL_VALUE,ADVANCES=@ADVANCES,NOCHANGE=@NOCHANGE,DECLINES=@DECLINES,PRIOR_MARKET_INDEX=@PRIOR_MARKET_INDEX,CHG_INDEX=@CHG_INDEX,PCT_INDEX=@PCT_INDEX,CURRENT_INDEX=@CURRENT_INDEX,MARKET_INDEX=@MARKET_INDEX,SESSION_NO=@SESSION_NO,PRV_PRIOR_MARKET_INDEX=@PRV_PRIOR_MARKET_INDEX,AVR_MARKET_INDEX=@AVR_MARKET_INDEX,AVR_PRIOR_MARKET_INDEX=@AVR_PRIOR_MARKET_INDEX,AVR_CHG_INDEX=@AVR_CHG_INDEX,AVR_PCT_INDEX=@AVR_PCT_INDEX,PT_TOTAL_QTTY=@PT_TOTAL_QTTY,PT_TOTAL_VALUE=@PT_TOTAL_VALUE,PT_TOTAL_TRADE=@PT_TOTAL_TRADE;";

        private static string Insert_STS_ORDERS = "INSERT INTO STS_ORDERS (FLOOR_CODE, ORDER_NO, ORDER_DATE, ORDER_TIME, MEMBER_ID, ACCOUNT_ID, STOCK_ID, ORDER_TYPE, PRIORITY, OORB, NORP, NORC, BORE, AORI, SETTLEMENT_TYPE, DORF, ORDER_QTTY, ORDER_PRICE, STATUS, QUOTE_PRICE, QUOTE_TIME, QUOTE_QTTY, ACCOUNT_NO, BROKER_ID, TELEPHONE, SESSION_NO, SETTLE_DAY, AORC, YIELDMAT, CODE_TRADE) VALUES (@FLOOR_CODE, @ORDER_NO, @ORDER_DATE, @ORDER_TIME, @MEMBER_ID, @ACCOUNT_ID, @STOCK_ID, @ORDER_TYPE, @PRIORITY, @OORB, @NORP, @NORC, @BORE, @AORI, @SETTLEMENT_TYPE, @DORF, @ORDER_QTTY, @ORDER_PRICE, @STATUS, @QUOTE_PRICE, @QUOTE_TIME, @QUOTE_QTTY, @ACCOUNT_NO, @BROKER_ID, @TELEPHONE, @SESSION_NO, @SETTLE_DAY, @AORC, @YIELDMAT, @CODE_TRADE) ON DUPLICATE KEY UPDATE FLOOR_CODE=@FLOOR_CODE, ORDER_NO=@ORDER_NO, ORDER_DATE=@ORDER_DATE, ORDER_TIME=@ORDER_TIME, MEMBER_ID=@MEMBER_ID, ACCOUNT_ID=@ACCOUNT_ID, STOCK_ID=@STOCK_ID, ORDER_TYPE=@ORDER_TYPE, PRIORITY=@PRIORITY, OORB=@OORB, NORP=@NORP, NORC=@NORC, BORE=@BORE, AORI=@AORI, SETTLEMENT_TYPE=@SETTLEMENT_TYPE, DORF=@DORF, ORDER_QTTY=@ORDER_QTTY, ORDER_PRICE=@ORDER_PRICE, STATUS=@STATUS, QUOTE_PRICE=@QUOTE_PRICE, QUOTE_TIME=@QUOTE_TIME, QUOTE_QTTY=@QUOTE_QTTY, ACCOUNT_NO=@ACCOUNT_NO, BROKER_ID=@BROKER_ID, TELEPHONE=@TELEPHONE, SESSION_NO=@SESSION_NO, SETTLE_DAY=@SETTLE_DAY, AORC=@AORC, YIELDMAT=@YIELDMAT, CODE_TRADE=@CODE_TRADE;";

        private static string Insert_STS_TRADING_RESULT = "INSERT INTO STS_TRADING_RESULT                         (FLOOR_CODE, TRADING_DATE, CONFIRM_NO, B_ORDER_NO, B_ORDER_DATE, S_ORDER_NO, S_ORDER_DATE, B_NEXT_CNFRM, S_NEXT_CNFRM, MATCH_TIME, MATCH_DATE, B_TRADING_ID, S_TRADING_ID, B_CODE_TRADE, S_CODE_TRADE, STATUS, SEC_CODE, QUANTITY, PRICE, B_ACCOUNT_NO, S_ACCOUNT_NO, SETT_TYPE, SETT_DATE, B_PC_FLAG, S_PC_FLAG, NORP) VALUES       (@FLOOR_CODE,@TRADING_DATE,@CONFIRM_NO,@B_ORDER_NO,@B_ORDER_DATE,@S_ORDER_NO,@S_ORDER_DATE,@B_NEXT_CNFRM,@S_NEXT_CNFRM,@MATCH_TIME,@MATCH_DATE,@B_TRADING_ID,@S_TRADING_ID,@B_CODE_TRADE,@S_CODE_TRADE,@STATUS,@SEC_CODE,@QUANTITY,@PRICE,@B_ACCOUNT_NO,@S_ACCOUNT_NO,@SETT_TYPE,@SETT_DATE,@B_PC_FLAG,@S_PC_FLAG,@NORP)  ON DUPLICATE KEY UPDATE FLOOR_CODE=@FLOOR_CODE,TRADING_DATE=@TRADING_DATE,CONFIRM_NO=@CONFIRM_NO,B_ORDER_NO=@B_ORDER_NO,B_ORDER_DATE=@B_ORDER_DATE,S_ORDER_NO=@S_ORDER_NO,S_ORDER_DATE=@S_ORDER_DATE,B_NEXT_CNFRM=@B_NEXT_CNFRM,S_NEXT_CNFRM=@S_NEXT_CNFRM,MATCH_TIME=@MATCH_TIME,MATCH_DATE=@MATCH_DATE,B_TRADING_ID=@B_TRADING_ID,S_TRADING_ID=@S_TRADING_ID,B_CODE_TRADE=@B_CODE_TRADE,S_CODE_TRADE=@S_CODE_TRADE,STATUS=@STATUS,SEC_CODE=@SEC_CODE,QUANTITY=@QUANTITY,PRICE=@PRICE,B_ACCOUNT_NO=@B_ACCOUNT_NO,S_ACCOUNT_NO=@S_ACCOUNT_NO,SETT_TYPE=@SETT_TYPE,SETT_DATE=@SETT_DATE,B_PC_FLAG=@B_PC_FLAG,S_PC_FLAG=@S_PC_FLAG,NORP=@NORP;";

        private static string Insert_STS_STOCKSINFO = "INSERT INTO STS_STOCKSINFO (STOCK_INFO_ID, TRADING_DATE, TIME, STOCK_ID, CODE, STOCK_TYPE, TOTAL_LISTING_QTTY, TRADING_UNIT, LISTTING_STATUS, ADJUST_QTTY, REFERENCE_STATUS, ADJUST_RATE, DIVIDENT_RATE, STATUS, TOTAL_ROOM, CURRENT_ROOM, BASIC_PRICE, OPEN_PRICE, CLOSE_PRICE, CURRENT_PRICE, CURRENT_QTTY, HIGHEST_PRICE, LOWEST_PRICE, BEST_OFFER_PRICE, BEST_BID_PRICE, CEILING_PRICE, FLOOR_PRICE, TOTAL_OFFER_QTTY, TOTAL_BID_QTTY, BEST_OFFER_QTTY, BEST_BID_QTTY, PRIOR_PRICE, PRIOR_CLOSE_PRICE, MATCH_PRICE, MATCH_QTTY, DELETED, DATE_CREATED, DATE_MODIFIED, MODIFIED_BY, CREATED_BY, NAME, PARVALUE, MATCH_VALUE, FLOOR_CODE, IS_CALCINDEX, IS_DETERMINECL, DATE_NO, OFFER_COUNT, BID_COUNT, AVERAGE_PRICE, INDEX_PRICE, PREV_PRIOR_PRICE, YIELDMAT, PREV_PRIOR_CLOSE_PRICE, NM_TOTAL_TRADED_VALUE, PT_MATCH_QTTY, PT_MATCH_PRICE, PT_TOTAL_TRADED_QTTY, PT_TOTAL_TRADED_VALUE, TOTAL_BUY_TRADING_QTTY, BUY_COUNT, TOTAL_BUY_TRADING_VALUE, TOTAL_SELL_TRADING_QTTY, SELL_COUNT, TOTAL_SELL_TRADING_VALUE, TOTAL_TRADING_QTTY, TOTAL_TRADING_VALUE, BUY_FOREIGN_QTTY, BUY_FOREIGN_VALUE, SELL_FOREIGN_QTTY, SELL_FOREIGN_VALUE, REMAIN_FOREIGN_QTTY, PT_YIELDMAT)        VALUES (@STOCK_INFO_ID, @TRADING_DATE, @TIME, @STOCK_ID, @CODE, @STOCK_TYPE, @TOTAL_LISTING_QTTY, @TRADING_UNIT, @LISTTING_STATUS, @ADJUST_QTTY, @REFERENCE_STATUS, @ADJUST_RATE, @DIVIDENT_RATE, @STATUS, @TOTAL_ROOM, @CURRENT_ROOM, @BASIC_PRICE, @OPEN_PRICE, @CLOSE_PRICE, @CURRENT_PRICE, @CURRENT_QTTY, @HIGHEST_PRICE, @LOWEST_PRICE, @BEST_OFFER_PRICE, @BEST_BID_PRICE, @CEILING_PRICE, @FLOOR_PRICE, @TOTAL_OFFER_QTTY, @TOTAL_BID_QTTY, @BEST_OFFER_QTTY, @BEST_BID_QTTY, @PRIOR_PRICE, @PRIOR_CLOSE_PRICE, @MATCH_PRICE, @MATCH_QTTY, @DELETED, @DATE_CREATED, @DATE_MODIFIED, @MODIFIED_BY, @CREATED_BY, @NAME, @PARVALUE, @MATCH_VALUE, @FLOOR_CODE, @IS_CALCINDEX, @IS_DETERMINECL, @DATE_NO, @OFFER_COUNT, @BID_COUNT, @AVERAGE_PRICE, @INDEX_PRICE, @PREV_PRIOR_PRICE, @YIELDMAT, @PREV_PRIOR_CLOSE_PRICE, @NM_TOTAL_TRADED_VALUE, @PT_MATCH_QTTY, @PT_MATCH_PRICE, @PT_TOTAL_TRADED_QTTY, @PT_TOTAL_TRADED_VALUE, @TOTAL_BUY_TRADING_QTTY, @BUY_COUNT, @TOTAL_BUY_TRADING_VALUE, @TOTAL_SELL_TRADING_QTTY, @SELL_COUNT, @TOTAL_SELL_TRADING_VALUE, @TOTAL_TRADING_QTTY, @TOTAL_TRADING_VALUE, @BUY_FOREIGN_QTTY, @BUY_FOREIGN_VALUE, @SELL_FOREIGN_QTTY, @SELL_FOREIGN_VALUE, @REMAIN_FOREIGN_QTTY, @PT_YIELDMAT)     ON DUPLICATE KEY UPDATE  TRADING_DATE=@TRADING_DATE, TIME=@TIME, CODE=@CODE, TOTAL_LISTING_QTTY=@TOTAL_LISTING_QTTY, TRADING_UNIT=@TRADING_UNIT, LISTTING_STATUS=@LISTTING_STATUS, ADJUST_QTTY=@ADJUST_QTTY, REFERENCE_STATUS=@REFERENCE_STATUS, ADJUST_RATE=@ADJUST_RATE, DIVIDENT_RATE=@DIVIDENT_RATE, STATUS=@STATUS, TOTAL_ROOM=@TOTAL_ROOM, CURRENT_ROOM=@CURRENT_ROOM, BASIC_PRICE=@BASIC_PRICE, OPEN_PRICE=@OPEN_PRICE, CLOSE_PRICE=@CLOSE_PRICE, CURRENT_PRICE=@CURRENT_PRICE, CURRENT_QTTY=@CURRENT_QTTY, HIGHEST_PRICE=@HIGHEST_PRICE, LOWEST_PRICE=@LOWEST_PRICE, BEST_OFFER_PRICE=@BEST_OFFER_PRICE, BEST_BID_PRICE=@BEST_BID_PRICE, CEILING_PRICE=@CEILING_PRICE, FLOOR_PRICE=@FLOOR_PRICE, TOTAL_OFFER_QTTY=@TOTAL_OFFER_QTTY, TOTAL_BID_QTTY=@TOTAL_BID_QTTY, BEST_OFFER_QTTY=@BEST_OFFER_QTTY, BEST_BID_QTTY=@BEST_BID_QTTY, PRIOR_PRICE=@PRIOR_PRICE, PRIOR_CLOSE_PRICE=@PRIOR_CLOSE_PRICE, MATCH_PRICE=@MATCH_PRICE, MATCH_QTTY=@MATCH_QTTY, DELETED=@DELETED, DATE_CREATED=@DATE_CREATED, DATE_MODIFIED=@DATE_MODIFIED, MODIFIED_BY=@MODIFIED_BY, CREATED_BY=@CREATED_BY, NAME=@NAME, PARVALUE=@PARVALUE, MATCH_VALUE=@MATCH_VALUE, FLOOR_CODE=@FLOOR_CODE, IS_CALCINDEX=@IS_CALCINDEX, IS_DETERMINECL=@IS_DETERMINECL, DATE_NO=@DATE_NO, OFFER_COUNT=@OFFER_COUNT, BID_COUNT=@BID_COUNT, AVERAGE_PRICE=@AVERAGE_PRICE, INDEX_PRICE=@INDEX_PRICE, PREV_PRIOR_PRICE=@PREV_PRIOR_PRICE, YIELDMAT=@YIELDMAT, PREV_PRIOR_CLOSE_PRICE=@PREV_PRIOR_CLOSE_PRICE, NM_TOTAL_TRADED_VALUE=@NM_TOTAL_TRADED_VALUE, PT_MATCH_QTTY=@PT_MATCH_QTTY, PT_MATCH_PRICE=@PT_MATCH_PRICE, PT_TOTAL_TRADED_QTTY=@PT_TOTAL_TRADED_QTTY, PT_TOTAL_TRADED_VALUE=@PT_TOTAL_TRADED_VALUE, TOTAL_BUY_TRADING_QTTY=@TOTAL_BUY_TRADING_QTTY, BUY_COUNT=@BUY_COUNT, TOTAL_BUY_TRADING_VALUE=@TOTAL_BUY_TRADING_VALUE, TOTAL_SELL_TRADING_QTTY=@TOTAL_SELL_TRADING_QTTY, SELL_COUNT=@SELL_COUNT, TOTAL_SELL_TRADING_VALUE=@TOTAL_SELL_TRADING_VALUE, TOTAL_TRADING_QTTY=@TOTAL_TRADING_QTTY, TOTAL_TRADING_VALUE=@TOTAL_TRADING_VALUE, BUY_FOREIGN_QTTY=@BUY_FOREIGN_QTTY, BUY_FOREIGN_VALUE=@BUY_FOREIGN_VALUE, SELL_FOREIGN_QTTY=@SELL_FOREIGN_QTTY, SELL_FOREIGN_VALUE=@SELL_FOREIGN_VALUE, REMAIN_FOREIGN_QTTY=@REMAIN_FOREIGN_QTTY, PT_YIELDMAT=@PT_YIELDMAT;";

        private static string Insert_STS_TOP3_PRICE_A = "INSERT INTO STS_TOP3_PRICE_A (STOCK_ID, TRADING_DATE, B_ORD_QTTY_3, B_ORD_PRICE_3, B_ORD_QTTY_2, B_ORD_PRICE_2, B_ORD_QTTY_1, B_ORD_PRICE_1, S_ORD_PRICE_1, S_ORD_QTTY_1, S_ORD_PRICE_2, S_ORD_QTTY_2, S_ORD_PRICE_3, S_ORD_QTTY_3) VALUES (@STOCK_ID, @TRADING_DATE, @B_ORD_QTTY_3, @B_ORD_PRICE_3, @B_ORD_QTTY_2, @B_ORD_PRICE_2, @B_ORD_QTTY_1, @B_ORD_PRICE_1, @S_ORD_PRICE_1, @S_ORD_QTTY_1, @S_ORD_PRICE_2, @S_ORD_QTTY_2, @S_ORD_PRICE_3, @S_ORD_QTTY_3)   ON DUPLICATE KEY UPDATE     STOCK_ID=@STOCK_ID, TRADING_DATE=@TRADING_DATE, B_ORD_QTTY_3=@B_ORD_QTTY_3, B_ORD_PRICE_3=@B_ORD_PRICE_3, B_ORD_QTTY_2=@B_ORD_QTTY_2, B_ORD_PRICE_2=@B_ORD_PRICE_2, B_ORD_QTTY_1=@B_ORD_QTTY_1, B_ORD_PRICE_1=@B_ORD_PRICE_1, S_ORD_PRICE_1=@S_ORD_PRICE_1, S_ORD_QTTY_1=@S_ORD_QTTY_1, S_ORD_PRICE_2=@S_ORD_PRICE_2, S_ORD_QTTY_2=@S_ORD_QTTY_2, S_ORD_PRICE_3=@S_ORD_PRICE_3, S_ORD_QTTY_3=@S_ORD_QTTY_3;";

        private static string Insert_STS_TOP3_PRICE_B = "INSERT INTO STS_TOP3_PRICE_B (STOCK_ID, TRADING_DATE, ORDER_QTTY_SELL, ORDER_PRICE_SELL, YIELDMAT_SELL, ORDER_QTTY_BUY, ORDER_PRICE_BUY, YIELDMAT_BUY) VALUES (@STOCK_ID, @TRADING_DATE, @ORDER_QTTY_SELL, @ORDER_PRICE_SELL, @YIELDMAT_SELL, @ORDER_QTTY_BUY, @ORDER_PRICE_BUY, @YIELDMAT_BUY)  ON DUPLICATE KEY UPDATE STOCK_ID=@STOCK_ID, TRADING_DATE=@TRADING_DATE, ORDER_QTTY_SELL=@ORDER_QTTY_SELL, ORDER_PRICE_SELL=@ORDER_PRICE_SELL, YIELDMAT_SELL=@YIELDMAT_SELL, ORDER_QTTY_BUY=@ORDER_QTTY_BUY, ORDER_PRICE_BUY=@ORDER_PRICE_BUY, YIELDMAT_BUY=@YIELDMAT_BUY;";


        private static string Count_STS_LE = "SELECT COUNT(*) FROM STS_LE";

        private static string Count_STS_LE_BYCODE = "SELECT COUNT(*) FROM STS_LE WHERE (CODE=@CODE) AND (TOTAL_TRADING_QTTY>=@TOTAL_TRADING_QTTY)";

        private static string Count_STS_MARKETINFO = "SELECT COUNT(*) FROM STS_MARKETINFO";

        private static string Count_STS_MARKETINFO_BYTIME = "SELECT COUNT(*) FROM STS_MARKETINFO WHERE `TIME`=@time";

        private static string Count_STS_ORDERS = "SELECT COUNT(*) FROM STS_ORDERS";

        private static string Count_STS_STOCKSINFO = "SELECT COUNT(*) FROM STS_STOCKSINFO";

        private static string Count_STS_TOP3_PRICE_A = "SELECT  COUNT(*) FROM STS_TOP3_PRICE_A";

        private static string Count_STS_TOP3_PRICE_B = "SELECT  COUNT(*) FROM STS_TOP3_PRICE_B";

        private static string Count_STS_TRADING_RESULT = "SELECT COUNT(*) FROM STS_TRADING_RESULT";

        private static string DELETE_STS_LE = "DELETE FROM STS_LE";

        private static string DELETE_STS_MARKETINFO = "DELETE FROM STS_MARKETINFO";

        private static string DELETE_STS_ORDERS = "DELETE FROM STS_ORDERS";

        private static string DELETE_STS_STOCKSINFO = "DELETE FROM STS_STOCKSINFO";

        private static string DELETE_STS_TOP3_PRICE_A = "DELETE FROM STS_TOP3_PRICE_A";

        private static string DELETE_STS_TOP3_PRICE_B = "DELETE FROM STS_TOP3_PRICE_B";

        private static string DELETE_STS_TRADING_RESULT = "DELETE FROM STS_TRADING_RESULT";

        private static string Update_STS_STOCKSINFO_BYCODE = "UPDATE       STS_STOCKSINFO SET                TRADING_DATE = @TRADING_DATE, TIME = @TIME,  CURRENT_ROOM = @CURRENT_ROOM, 					 OPEN_PRICE = @OPEN_PRICE, CLOSE_PRICE = @CLOSE_PRICE, CURRENT_PRICE = @CURRENT_PRICE,                         CURRENT_QTTY = @CURRENT_QTTY, HIGHEST_PRICE = @HIGHEST_PRICE, LOWEST_PRICE = @LOWEST_PRICE,                         BEST_OFFER_PRICE = @BEST_OFFER_PRICE, BEST_BID_PRICE = @BEST_BID_PRICE,					 TOTAL_OFFER_QTTY = @TOTAL_OFFER_QTTY, TOTAL_BID_QTTY = @TOTAL_BID_QTTY, BEST_OFFER_QTTY = @BEST_OFFER_QTTY, BEST_BID_QTTY = @BEST_BID_QTTY, PRIOR_PRICE = @PRIOR_PRICE, PRIOR_CLOSE_PRICE = @PRIOR_CLOSE_PRICE, MATCH_PRICE = @MATCH_PRICE, MATCH_QTTY = @MATCH_QTTY, MATCH_VALUE = @MATCH_VALUE, OFFER_COUNT = @OFFER_COUNT, BID_COUNT = @BID_COUNT,                        AVERAGE_PRICE = @AVERAGE_PRICE, INDEX_PRICE = @INDEX_PRICE, PREV_PRIOR_PRICE = @PREV_PRIOR_PRICE,PREV_PRIOR_CLOSE_PRICE = @PREV_PRIOR_CLOSE_PRICE, NM_TOTAL_TRADED_VALUE = @NM_TOTAL_TRADED_VALUE,PT_MATCH_QTTY = @PT_MATCH_QTTY, PT_MATCH_PRICE = @PT_MATCH_PRICE, PT_TOTAL_TRADED_QTTY = @PT_TOTAL_TRADED_QTTY,PT_TOTAL_TRADED_VALUE = @PT_TOTAL_TRADED_VALUE, TOTAL_BUY_TRADING_QTTY = @TOTAL_BUY_TRADING_QTTY,BUY_COUNT = @BUY_COUNT, TOTAL_BUY_TRADING_VALUE = @TOTAL_BUY_TRADING_VALUE, TOTAL_SELL_TRADING_QTTY = @TOTAL_SELL_TRADING_QTTY, SELL_COUNT = @SELL_COUNT,              TOTAL_SELL_TRADING_VALUE = @TOTAL_SELL_TRADING_VALUE, TOTAL_TRADING_QTTY = @TOTAL_TRADING_QTTY,                          TOTAL_TRADING_VALUE = @TOTAL_TRADING_VALUE, BUY_FOREIGN_QTTY = @BUY_FOREIGN_QTTY, BUY_FOREIGN_VALUE = @BUY_FOREIGN_VALUE,                          SELL_FOREIGN_QTTY = @SELL_FOREIGN_QTTY, SELL_FOREIGN_VALUE = @SELL_FOREIGN_VALUE, REMAIN_FOREIGN_QTTY = @REMAIN_FOREIGN_QTTY WHERE        (CODE = @CODE);";

        private static string Update_STS_MARKETINFO = "UPDATE    STS_MARKETINFO SET              FLOOR_CODE = @FLOOR_CODE, DATE_NO = @DATE_NO, TRADING_DATE = @TRADING_DATE, CURRENT_STATUS = @CURRENT_STATUS, TIME = @TIME, TOTAL_TRADE = @TOTAL_TRADE, TOTAL_STOCK = @TOTAL_STOCK, TOTAL_QTTY = @TOTAL_QTTY,         TOTAL_VALUE = @TOTAL_VALUE, ADVANCES = @ADVANCES, NOCHANGE = @NOCHANGE, DECLINES = @DECLINES,                       PRIOR_MARKET_INDEX = @PRIOR_MARKET_INDEX, CHG_INDEX = @CHG_INDEX, PCT_INDEX = @PCT_INDEX,                      CURRENT_INDEX = @CURRENT_INDEX, MARKET_INDEX = @MARKET_INDEX, SESSION_NO = @SESSION_NO,                       PRV_PRIOR_MARKET_INDEX = @PRV_PRIOR_MARKET_INDEX, AVR_MARKET_INDEX = @AVR_MARKET_INDEX,                       AVR_PRIOR_MARKET_INDEX = @AVR_PRIOR_MARKET_INDEX, AVR_CHG_INDEX = @AVR_CHG_INDEX, AVR_PCT_INDEX = @AVR_PCT_INDEX, PT_TOTAL_QTTY = @PT_TOTAL_QTTY, PT_TOTAL_VALUE = @PT_TOTAL_VALUE, PT_TOTAL_TRADE = @PT_TOTAL_TRADE; ";

        private static string Update_STS_TOP3_PRICE_A = "UPDATE STS_TOP3_PRICE_A SET TRADING_DATE = @TRADING_DATE, B_ORD_QTTY_3 = @B_ORD_QTTY_3, B_ORD_PRICE_3 = @B_ORD_PRICE_3, B_ORD_QTTY_2 = @B_ORD_QTTY_2, B_ORD_PRICE_2 = @B_ORD_PRICE_2, B_ORD_QTTY_1 = @B_ORD_QTTY_1, B_ORD_PRICE_1 = @B_ORD_PRICE_1, S_ORD_PRICE_1 = @S_ORD_PRICE_1, S_ORD_QTTY_1 = @S_ORD_QTTY_1, S_ORD_PRICE_2 = @S_ORD_PRICE_2, S_ORD_QTTY_2 = @S_ORD_QTTY_2, S_ORD_PRICE_3 = @S_ORD_PRICE_3, S_ORD_QTTY_3 = @S_ORD_QTTY_3 WHERE STOCK_ID = @STOCK_ID	";

        private static string Update_STS_TOP3_PRICE_B = "UPDATE STS_TOP3_PRICE_B SET TRADING_DATE = @TRADING_DATE, ORDER_QTTY_SELL = @ORDER_QTTY_SELL, ORDER_PRICE_SELL = @ORDER_PRICE_SELL, YIELDMAT_SELL = @YIELDMAT_SELL, ORDER_QTTY_BUY = @ORDER_QTTY_BUY, ORDER_PRICE_BUY = @ORDER_PRICE_BUY, YIELDMAT_BUY = @YIELDMAT_BUY WHERE STOCK_ID = @STOCK_ID";

        private static string Select_StocksInfo = "SELECT stockno, symbol, stockname FROM _securities_info where market='HASTC'";
        private static string Select_MarketInfo = "SELECT * FROM STS_MARKETINFO";
        private static string Select_Top3A = "SELECT * FROM STS_TOP3_PRICE_A";
        private static string Select_Top3B = "SELECT * FROM STS_TOP3_PRICE_B";
        private static string Select_Orders = "SELECT * FROM STS_ORDERS";
        private static string Select_TradingResult = "SELECT * FROM STS_TRADING_RESULT";

        private static string Delete_HastcOrders = "DELETE FROM STS_LE; DELETE FROM STS_MARKETINFO;DELETE FROM STS_ORDERS;DELETE FROM STS_TOP3_PRICE_A;DELETE FROM STS_TOP3_PRICE_B;DELETE FROM STS_TRADING_RESULT;";


        private static string Delete_BackupHastcOrders = 
            //"DELETE FROM STS_backup_LE  where datediff(TIME,current_date)=0;" +
            //"DELETE FROM STS_backup_MARKETINFO  where datediff(TRADING_DATE,current_date)=0;" +
            "DELETE FROM STS_backup_ORDERS  where datediff(ORDER_DATE,current_date)=0;" +
            //"DELETE FROM STS_backup_STOCKSINFO  where datediff(trading_date,current_date)=0;" + 
            //"DELETE FROM STS_backup_TOP3_PRICE_A  where datediff(trading_date,current_date)=0;" + 
            //"DELETE FROM STS_backup_TOP3_PRICE_B  where datediff(trading_date,current_date)=0;" + 
            "DELETE FROM STS_backup_TRADING_RESULT  where datediff(trading_date,current_date)=0;";

        private static string Insert_BackupHastcOrders =
            //"INSERT INTO sts_backup_le select * from sts_le ;" +
            //"insert into sts_backup_marketinfo(FLOOR_CODE,DATE_NO,TRADING_DATE,CURRENT_STATUS,TIME,TOTAL_TRADE,TOTAL_STOCK,TOTAL_QTTY,TOTAL_VALUE,ADVANCES,NOCHANGE,DECLINES,PRIOR_MARKET_INDEX,CHG_INDEX,PCT_INDEX,CURRENT_INDEX,MARKET_INDEX,SESSION_NO,PRV_PRIOR_MARKET_INDEX,AVR_MARKET_INDEX,AVR_PRIOR_MARKET_INDEX,AVR_CHG_INDEX,AVR_PCT_INDEX,PT_TOTAL_QTTY,PT_TOTAL_VALUE,PT_TOTAL_TRADE) select FLOOR_CODE,DATE_NO,TRADING_DATE,CURRENT_STATUS,TIME,TOTAL_TRADE,TOTAL_STOCK,TOTAL_QTTY,TOTAL_VALUE,ADVANCES,NOCHANGE,DECLINES,PRIOR_MARKET_INDEX,CHG_INDEX,PCT_INDEX,CURRENT_INDEX,MARKET_INDEX,SESSION_NO,PRV_PRIOR_MARKET_INDEX,AVR_MARKET_INDEX,AVR_PRIOR_MARKET_INDEX,AVR_CHG_INDEX,AVR_PCT_INDEX,PT_TOTAL_QTTY,PT_TOTAL_VALUE,PT_TOTAL_TRADE from sts_marketinfo;" +
            "INSERT INTO sts_backup_orders select * from sts_orders;" +
            //"INSERT INTO sts_backup_stocksinfo select * from sts_stocksinfo;" +
            //"INSERT INTO sts_backup_top3_price_a select * from sts_top3_price_a;" +
            //"INSERT INTO sts_backup_top3_price_b select * from sts_top3_price_b;" +
            "INSERT INTO sts_backup_trading_result select * from sts_trading_result";

        private static string Insert_SecuritiesInfo = "INSERT INTO _SECURITIES_INFO(STOCKNO, SYMBOL, MARKET) VALUE (@STOCKNO, @STOCKSYMBOL, @MARKET) ON DUPLICATE KEY UPDATE STOCKNO=@STOCKNO, SYMBOL=@STOCKSYMBOL, MARKET=@MARKET";

        private static string Select_Backup_StocksInfo = "SELECT stockno, symbol, stockname FROM _securities_info where market='HASTC';";
        private static string Select_Backup_MarketInfo = "SELECT * FROM STS_backup_MARKETINFO where trans_date between @from and @to";
        private static string Select_Backup_Top3A = "SELECT * FROM STS_backup_TOP3_PRICE_A where trading_date between @from and @to";
        private static string Select_Backup_Top3B = "SELECT * FROM STS_backup_TOP3_PRICE_B  where trading_date between @from and @to";
        private static string Select_Backup_Orders = "SELECT * FROM STS_backup_ORDERS where order_date between @from and @to";
        private static string Select_Backup_TradingResult = "SELECT * FROM STS_backup_TRADING_RESULT where trading_date between @from and @to";

        #endregion

        #region IStsStocks Members


        public int CountSTS_STOCKSINFO()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_STOCKSINFO));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_STOCKSINFO()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text
                    , DELETE_STS_STOCKSINFO);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_STOCKSINFO(STS_STOCKSINFO item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                        new MySqlParameter( PARM_STOCK_INFO_ID,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_TIME,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CODE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_STOCK_TYPE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_LISTING_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TRADING_UNIT,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_LISTTING_STATUS,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ADJUST_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_REFERENCE_STATUS,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ADJUST_RATE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_DIVIDENT_RATE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_STATUS,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_ROOM,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CURRENT_ROOM,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BASIC_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_OPEN_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CLOSE_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CURRENT_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CURRENT_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_HIGHEST_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_LOWEST_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BEST_OFFER_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BEST_BID_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CEILING_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_FLOOR_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_OFFER_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_BID_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BEST_OFFER_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BEST_BID_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PRIOR_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PRIOR_CLOSE_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_MATCH_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_MATCH_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_DELETED,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_DATE_CREATED,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_DATE_MODIFIED,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_MODIFIED_BY,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_CREATED_BY,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_NAME,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_PARVALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_MATCH_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_IS_CALCINDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_IS_DETERMINECL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_DATE_NO,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_OFFER_COUNT,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BID_COUNT,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVERAGE_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_INDEX_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PREV_PRIOR_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_YIELDMAT,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PREV_PRIOR_CLOSE_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_NM_TOTAL_TRADED_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_NM_TOTAL_TRADED_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_MATCH_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_MATCH_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_TRADED_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_TRADED_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_BUY_TRADING_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BUY_COUNT,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_BUY_TRADING_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_SELL_TRADING_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SELL_COUNT,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_SELL_TRADING_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_TRADING_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_TRADING_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BUY_FOREIGN_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_BUY_FOREIGN_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SELL_FOREIGN_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SELL_FOREIGN_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_REMAIN_FOREIGN_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_YIELDMAT,MySqlDbType.Decimal)
                };

                parms[0].Value = item.STOCK_INFO_ID;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.TIME;
                parms[3].Value = item.STOCK_ID;
                parms[4].Value = item.CODE;
                parms[5].Value = item.STOCK_TYPE;
                parms[6].Value = item.TOTAL_LISTING_QTTY;
                parms[7].Value = item.TRADING_UNIT;
                parms[8].Value = item.LISTTING_STATUS;
                parms[9].Value = item.ADJUST_QTTY;
                parms[10].Value = item.REFERENCE_STATUS;
                parms[11].Value = item.ADJUST_RATE;
                parms[12].Value = item.DIVIDENT_RATE;
                parms[13].Value = item.STATUS;
                parms[14].Value = item.TOTAL_ROOM;
                parms[15].Value = item.CURRENT_ROOM;
                parms[16].Value = item.BASIC_PRICE;
                parms[17].Value = item.OPEN_PRICE;
                parms[18].Value = item.CLOSE_PRICE;
                parms[19].Value = item.CURRENT_PRICE;
                parms[20].Value = item.CURRENT_QTTY;
                parms[21].Value = item.HIGHEST_PRICE;
                parms[22].Value = item.LOWEST_PRICE;
                parms[23].Value = item.BEST_OFFER_PRICE;
                parms[24].Value = item.BEST_BID_PRICE;
                parms[25].Value = item.CEILING_PRICE;
                parms[26].Value = item.FLOOR_PRICE;
                parms[27].Value = item.TOTAL_OFFER_QTTY;
                parms[28].Value = item.TOTAL_BID_QTTY;
                parms[29].Value = item.BEST_OFFER_QTTY;
                parms[30].Value = item.BEST_BID_QTTY;
                parms[31].Value = item.PRIOR_PRICE;
                parms[32].Value = item.PRIOR_CLOSE_PRICE;
                parms[33].Value = item.MATCH_PRICE;
                parms[34].Value = item.MATCH_QTTY;
                parms[35].Value = item.DELETED;
                parms[36].Value = DateTime.Now; //item.DATE_CREATED;
                parms[37].Value = DateTime.Now;// item.DATE_MODIFIED;
                parms[38].Value = (item.MODIFIED_BY == null) ? "" : item.MODIFIED_BY;
                parms[39].Value = (item.CREATED_BY == null) ? "" : item.CREATED_BY;
                parms[40].Value = item.NAME;
                parms[41].Value = item.PARVALUE;
                parms[42].Value = item.MATCH_VALUE;
                parms[43].Value = item.FLOOR_CODE;
                parms[44].Value = item.IS_CALCINDEX;
                parms[45].Value = item.IS_DETERMINECL;
                parms[46].Value = item.DATE_NO;
                parms[47].Value = item.OFFER_COUNT;
                parms[48].Value = item.BID_COUNT;
                parms[49].Value = item.AVERAGE_PRICE;
                parms[50].Value = item.INDEX_PRICE;
                parms[51].Value = item.PREV_PRIOR_PRICE;
                parms[52].Value = item.YIELDMAT;
                parms[53].Value = item.PREV_PRIOR_CLOSE_PRICE;
                parms[54].Value = item.NM_TOTAL_TRADED_QTTY;
                parms[55].Value = item.NM_TOTAL_TRADED_VALUE;
                parms[56].Value = item.PT_MATCH_QTTY;
                parms[57].Value = item.PT_MATCH_PRICE;
                parms[58].Value = item.PT_TOTAL_TRADED_QTTY;
                parms[59].Value = item.PT_TOTAL_TRADED_VALUE;
                parms[60].Value = item.TOTAL_BUY_TRADING_QTTY;
                parms[61].Value = item.BUY_COUNT;
                parms[62].Value = item.TOTAL_BUY_TRADING_VALUE;
                parms[63].Value = item.TOTAL_SELL_TRADING_QTTY;
                parms[64].Value = item.SELL_COUNT;
                parms[65].Value = item.TOTAL_SELL_TRADING_VALUE;
                parms[66].Value = item.TOTAL_TRADING_QTTY;
                parms[67].Value = item.TOTAL_TRADING_VALUE;
                parms[68].Value = item.BUY_FOREIGN_QTTY;
                parms[69].Value = item.BUY_FOREIGN_VALUE;
                parms[70].Value = item.SELL_FOREIGN_QTTY;
                parms[71].Value = item.SELL_FOREIGN_VALUE;
                parms[72].Value = item.REMAIN_FOREIGN_QTTY;
                parms[73].Value = item.PT_YIELDMAT;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_STOCKSINFO, parms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void UpdateSTS_STOCKSINFO(STS_STOCKSINFO item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                                new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                                new MySqlParameter( PARM_TIME,MySqlDbType.VarChar),
                                new MySqlParameter( PARM_CURRENT_ROOM,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_OPEN_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_CLOSE_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_CURRENT_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_CURRENT_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_HIGHEST_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_LOWEST_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BEST_OFFER_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BEST_BID_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_OFFER_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_BID_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BEST_OFFER_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BEST_BID_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PRIOR_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PRIOR_CLOSE_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_MATCH_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_MATCH_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_MATCH_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_OFFER_COUNT,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BID_COUNT,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_AVERAGE_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_INDEX_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PREV_PRIOR_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PREV_PRIOR_CLOSE_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_NM_TOTAL_TRADED_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_NM_TOTAL_TRADED_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PT_MATCH_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PT_MATCH_PRICE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PT_TOTAL_TRADED_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_PT_TOTAL_TRADED_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_BUY_TRADING_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BUY_COUNT,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_BUY_TRADING_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_SELL_TRADING_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_SELL_COUNT,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_SELL_TRADING_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_TRADING_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_TOTAL_TRADING_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BUY_FOREIGN_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_BUY_FOREIGN_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_SELL_FOREIGN_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_SELL_FOREIGN_VALUE,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_REMAIN_FOREIGN_QTTY,MySqlDbType.Decimal),
                                new MySqlParameter( PARM_CODE,MySqlDbType.VarChar)
                };

                parms[0].Value = item.TRADING_DATE;
                parms[1].Value = item.TIME;
                parms[2].Value = item.CURRENT_ROOM;
                parms[3].Value = item.OPEN_PRICE;
                parms[4].Value = item.CLOSE_PRICE;
                parms[5].Value = item.CURRENT_PRICE;
                parms[6].Value = item.CURRENT_QTTY;
                parms[7].Value = item.HIGHEST_PRICE;
                parms[8].Value = item.LOWEST_PRICE;
                parms[9].Value = item.BEST_OFFER_PRICE;
                parms[10].Value = item.BEST_BID_PRICE;
                parms[11].Value = item.TOTAL_OFFER_QTTY;
                parms[12].Value = item.TOTAL_BID_QTTY;
                parms[13].Value = item.BEST_OFFER_QTTY;
                parms[14].Value = item.BEST_BID_QTTY;
                parms[15].Value = item.PRIOR_PRICE;
                parms[16].Value = item.PRIOR_CLOSE_PRICE;
                parms[17].Value = item.MATCH_PRICE;
                parms[18].Value = item.MATCH_QTTY;
                parms[19].Value = item.MATCH_VALUE;
                parms[20].Value = item.OFFER_COUNT;
                parms[21].Value = item.BID_COUNT;
                parms[22].Value = item.AVERAGE_PRICE;
                parms[23].Value = item.INDEX_PRICE;
                parms[24].Value = item.PREV_PRIOR_PRICE;
                parms[25].Value = item.PREV_PRIOR_CLOSE_PRICE;
                parms[26].Value = item.NM_TOTAL_TRADED_QTTY;
                parms[27].Value = item.NM_TOTAL_TRADED_VALUE;
                parms[28].Value = item.PT_MATCH_QTTY;
                parms[29].Value = item.PT_MATCH_PRICE;
                parms[30].Value = item.PT_TOTAL_TRADED_QTTY;
                parms[31].Value = item.PT_TOTAL_TRADED_VALUE;
                parms[32].Value = item.TOTAL_BUY_TRADING_QTTY;
                parms[33].Value = item.BUY_COUNT;
                parms[34].Value = item.TOTAL_BUY_TRADING_VALUE;
                parms[35].Value = item.TOTAL_SELL_TRADING_QTTY;
                parms[36].Value = item.SELL_COUNT;
                parms[37].Value = item.TOTAL_SELL_TRADING_VALUE;
                parms[38].Value = item.TOTAL_TRADING_QTTY;
                parms[39].Value = item.TOTAL_TRADING_VALUE;
                parms[40].Value = item.BUY_FOREIGN_QTTY;
                parms[41].Value = item.BUY_FOREIGN_VALUE;
                parms[42].Value = item.SELL_FOREIGN_QTTY;
                parms[43].Value = item.SELL_FOREIGN_VALUE;
                parms[44].Value = item.REMAIN_FOREIGN_QTTY;
                parms[45].Value = item.CODE;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Update_STS_STOCKSINFO_BYCODE, parms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public int CountSTS_MARKETINFO()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_MARKETINFO));
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_MARKETINFO_BYTIME(string time)
        {
            try
            {
                MySqlParameter parm1 = new MySqlParameter(PARM_TIME, MySqlDbType.VarChar);
                parm1.Value = time;

                return Convert.ToInt32(MyHelper.ExecuteScalarSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_MARKETINFO_BYTIME, parm1));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_MARKETINFO()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, DELETE_STS_MARKETINFO);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_MARKETINFO(STS_MARKETINFO item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                        new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_DATE_NO,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_CURRENT_STATUS,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TIME,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_TOTAL_TRADE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_STOCK,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ADVANCES,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_NOCHANGE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_DECLINES,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PRIOR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CHG_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PCT_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CURRENT_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SESSION_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_PRV_PRIOR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_PRIOR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_CHG_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_PCT_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_TRADE,MySqlDbType.Decimal)
                };

                parms[0].Value = item.FLOOR_CODE;
                parms[1].Value = item.DATE_NO;
                parms[2].Value = item.TRADING_DATE;
                parms[3].Value = item.CURRENT_STATUS;
                parms[4].Value = item.TIME;
                parms[5].Value = item.TOTAL_TRADE;
                parms[6].Value = item.TOTAL_STOCK;
                parms[7].Value = item.TOTAL_QTTY;
                parms[8].Value = item.TOTAL_VALUE;
                parms[9].Value = item.ADVANCES;
                parms[10].Value = item.NOCHANGE;
                parms[11].Value = item.DECLINES;
                parms[12].Value = item.PRIOR_MARKET_INDEX;
                parms[13].Value = item.CHG_INDEX;
                parms[14].Value = item.PCT_INDEX;
                parms[15].Value = item.CURRENT_INDEX;
                parms[16].Value = item.MARKET_INDEX;
                parms[17].Value = (item.SESSION_NO == null) ? "" : item.SESSION_NO;
                parms[18].Value = item.PRV_PRIOR_MARKET_INDEX;
                parms[19].Value = item.AVR_MARKET_INDEX;
                parms[20].Value = item.AVR_PRIOR_MARKET_INDEX;
                parms[21].Value = item.AVR_CHG_INDEX;
                parms[22].Value = item.AVR_PCT_INDEX;
                parms[23].Value = item.PT_TOTAL_QTTY;
                parms[24].Value = item.PT_TOTAL_VALUE;
                parms[25].Value = item.PT_TOTAL_TRADE;

                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_MARKETINFO, parms);
            }
            catch
            {
                throw;
            }
        }

        public void UpdateSTS_MARKETINFO(STS_MARKETINFO item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                        new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_DATE_NO,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_CURRENT_STATUS,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TIME,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_TOTAL_TRADE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_STOCK,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TOTAL_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ADVANCES,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_NOCHANGE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_DECLINES,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PRIOR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CHG_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PCT_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_CURRENT_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SESSION_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_PRV_PRIOR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_PRIOR_MARKET_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_CHG_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_AVR_PCT_INDEX,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_QTTY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_VALUE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PT_TOTAL_TRADE,MySqlDbType.Decimal)
                };

                parms[0].Value = item.FLOOR_CODE;
                parms[1].Value = item.DATE_NO;
                parms[2].Value = item.TRADING_DATE;
                parms[3].Value = item.CURRENT_STATUS;
                parms[4].Value = item.TIME;
                parms[5].Value = item.TOTAL_TRADE;
                parms[6].Value = item.TOTAL_STOCK;
                parms[7].Value = item.TOTAL_QTTY;
                parms[8].Value = item.TOTAL_VALUE;
                parms[9].Value = item.ADVANCES;
                parms[10].Value = item.NOCHANGE;
                parms[11].Value = item.DECLINES;
                parms[12].Value = item.PRIOR_MARKET_INDEX;
                parms[13].Value = item.CHG_INDEX;
                parms[14].Value = item.PCT_INDEX;
                parms[15].Value = item.CURRENT_INDEX;
                parms[16].Value = item.MARKET_INDEX;
                parms[17].Value = (item.SESSION_NO == null) ? "" : item.SESSION_NO;
                parms[18].Value = item.PRV_PRIOR_MARKET_INDEX;
                parms[19].Value = item.AVR_MARKET_INDEX;
                parms[20].Value = item.AVR_PRIOR_MARKET_INDEX;
                parms[21].Value = item.AVR_CHG_INDEX;
                parms[22].Value = item.AVR_PCT_INDEX;
                parms[23].Value = item.PT_TOTAL_QTTY;
                parms[24].Value = item.PT_TOTAL_VALUE;
                parms[25].Value = item.PT_TOTAL_TRADE;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Update_STS_MARKETINFO, parms);
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_TOP3_PRICE_A()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_TOP3_PRICE_A));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_TOP3_PRICE_A()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, DELETE_STS_TOP3_PRICE_A);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_TOP3_PRICE_A(STS_TOP3_PRICE_A item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                    new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                    new MySqlParameter( PARM_B_ORD_QTTY_3,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_PRICE_3,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_QTTY_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_PRICE_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_QTTY_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_PRICE_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_PRICE_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_QTTY_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_PRICE_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_QTTY_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_PRICE_3,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_QTTY_3,MySqlDbType.Decimal)
                };

                parms[0].Value = item.STOCK_ID;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.B_ORD_QTTY_3;
                parms[3].Value = item.B_ORD_PRICE_3;
                parms[4].Value = item.B_ORD_QTTY_2;
                parms[5].Value = item.B_ORD_PRICE_2;
                parms[6].Value = item.B_ORD_QTTY_1;
                parms[7].Value = item.B_ORD_PRICE_1;
                parms[8].Value = item.S_ORD_PRICE_1;
                parms[9].Value = item.S_ORD_QTTY_1;
                parms[10].Value = item.S_ORD_PRICE_2;
                parms[11].Value = item.S_ORD_QTTY_2;
                parms[12].Value = item.S_ORD_PRICE_3;
                parms[13].Value = item.S_ORD_QTTY_3;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_TOP3_PRICE_A, parms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void UpdateSTS_TOP3_PRICE_A(STS_TOP3_PRICE_A item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                    new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                    new MySqlParameter( PARM_B_ORD_QTTY_3,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_PRICE_3,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_QTTY_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_PRICE_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_QTTY_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_B_ORD_PRICE_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_PRICE_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_QTTY_1,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_PRICE_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_QTTY_2,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_PRICE_3,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_S_ORD_QTTY_3,MySqlDbType.Decimal)
                };

                parms[0].Value = item.STOCK_ID;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.B_ORD_QTTY_3;
                parms[3].Value = item.B_ORD_PRICE_3;
                parms[4].Value = item.B_ORD_QTTY_2;
                parms[5].Value = item.B_ORD_PRICE_2;
                parms[6].Value = item.B_ORD_QTTY_1;
                parms[7].Value = item.B_ORD_PRICE_1;
                parms[8].Value = item.S_ORD_PRICE_1;
                parms[9].Value = item.S_ORD_QTTY_1;
                parms[10].Value = item.S_ORD_PRICE_2;
                parms[11].Value = item.S_ORD_QTTY_2;
                parms[12].Value = item.S_ORD_PRICE_3;
                parms[13].Value = item.S_ORD_QTTY_3;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Update_STS_TOP3_PRICE_A, parms);
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_TOP3_PRICE_B()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_TOP3_PRICE_B));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_TOP3_PRICE_B()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, DELETE_STS_TOP3_PRICE_B);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_TOP3_PRICE_B(STS_TOP3_PRICE_B item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                        new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_ORDER_QTTY_SELL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ORDER_PRICE_SELL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_YIELDMAT_SELL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ORDER_QTTY_BUY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ORDER_PRICE_BUY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_YIELDMAT_BUY,MySqlDbType.Decimal)
                };

                parms[0].Value = item.STOCK_ID;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.ORDER_QTTY_SELL;
                parms[3].Value = item.ORDER_PRICE_SELL;
                parms[4].Value = item.YIELDMAT_SELL;
                parms[5].Value = item.ORDER_QTTY_BUY;
                parms[6].Value = item.ORDER_PRICE_BUY;
                parms[7].Value = item.YIELDMAT_BUY;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_TOP3_PRICE_B, parms);
            }
            catch
            {
                throw;
            }
        }

        public void UpdateSTS_TOP3_PRICE_B(STS_TOP3_PRICE_B item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                        new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_ORDER_QTTY_SELL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ORDER_PRICE_SELL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_YIELDMAT_SELL,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ORDER_QTTY_BUY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_ORDER_PRICE_BUY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_YIELDMAT_BUY,MySqlDbType.Decimal)
                };

                parms[0].Value = item.STOCK_ID;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.ORDER_QTTY_SELL;
                parms[3].Value = item.ORDER_PRICE_SELL;
                parms[4].Value = item.YIELDMAT_SELL;
                parms[5].Value = item.ORDER_QTTY_BUY;
                parms[6].Value = item.ORDER_PRICE_BUY;
                parms[7].Value = item.YIELDMAT_BUY;

                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Update_STS_TOP3_PRICE_B, parms);
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_ORDERS()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_ORDERS));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_ORDERS()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, DELETE_STS_ORDERS);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_ORDERS(STS_ORDERS item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                    new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_ORDER_NO,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_ORDER_DATE,MySqlDbType.DateTime),
                    new MySqlParameter( PARM_ORDER_TIME,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_MEMBER_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ACCOUNT_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ORDER_TYPE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_PRIORITY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_OORB,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_NORP,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_NORC,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_BORE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_AORI,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_SETTLEMENT_TYPE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_DORF,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ORDER_QTTY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ORDER_PRICE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_STATUS,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_QUOTE_PRICE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_QUOTE_TIME,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_QUOTE_QTTY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ACCOUNT_NO,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_BROKER_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_TELEPHONE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_SESSION_NO,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_SETTLE_DAY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_AORC,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_YIELDMAT,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_CODE_TRADE,MySqlDbType.VarChar)
                };

                parms[0].Value = item.FLOOR_CODE;
                parms[1].Value = item.ORDER_NO;
                parms[2].Value = item.ORDER_DATE;
                parms[3].Value = item.ORDER_TIME;
                parms[4].Value = item.MEMBER_ID;
                parms[5].Value = item.ACCOUNT_ID;
                parms[6].Value = item.STOCK_ID;
                parms[7].Value = item.ORDER_TYPE;
                parms[8].Value = item.PRIORITY;
                parms[9].Value = item.OORB;
                parms[10].Value = item.NORP;
                parms[11].Value = item.NORC;
                parms[12].Value = item.BORE;
                parms[13].Value = item.AORI;
                parms[14].Value = item.SETTLEMENT_TYPE;
                parms[15].Value = item.DORF;
                parms[16].Value = item.ORDER_QTTY;
                parms[17].Value = item.ORDER_PRICE;
                parms[18].Value = item.STATUS;
                parms[19].Value = item.QUOTE_PRICE;
                parms[20].Value = item.QUOTE_TIME;
                parms[21].Value = item.QUOTE_QTTY;
                parms[22].Value = item.ACCOUNT_NO;
                parms[23].Value = item.BROKER_ID;
                parms[24].Value = item.TELEPHONE;
                parms[25].Value = (item.SESSION_NO == null) ? "" : item.SESSION_NO;
                parms[26].Value = item.SETTLE_DAY;
                parms[27].Value = item.AORC;
                parms[28].Value = item.YIELDMAT;
                parms[29].Value = item.CODE_TRADE;



                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_ORDERS, parms);
            }
            catch
            {
                throw;
            }
        }

        public void UpdateSTS_ORDERS(STS_ORDERS item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                    new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_ORDER_NO,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_ORDER_DATE,MySqlDbType.DateTime),
                    new MySqlParameter( PARM_ORDER_TIME,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_MEMBER_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ACCOUNT_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_STOCK_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ORDER_TYPE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_PRIORITY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_OORB,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_NORP,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_NORC,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_BORE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_AORI,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_SETTLEMENT_TYPE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_DORF,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ORDER_QTTY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ORDER_PRICE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_STATUS,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_QUOTE_PRICE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_QUOTE_TIME,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_QUOTE_QTTY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_ACCOUNT_NO,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_BROKER_ID,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_TELEPHONE,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_SESSION_NO,MySqlDbType.VarChar),
                    new MySqlParameter( PARM_SETTLE_DAY,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_AORC,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_YIELDMAT,MySqlDbType.Decimal),
                    new MySqlParameter( PARM_CODE_TRADE,MySqlDbType.VarChar)
                };

                parms[0].Value = item.FLOOR_CODE;
                parms[1].Value = item.ORDER_NO;
                parms[2].Value = item.ORDER_DATE;
                parms[3].Value = item.ORDER_TIME;
                parms[4].Value = item.MEMBER_ID;
                parms[5].Value = item.ACCOUNT_ID;
                parms[6].Value = item.STOCK_ID;
                parms[7].Value = item.ORDER_TYPE;
                parms[8].Value = item.PRIORITY;
                parms[9].Value = item.OORB;
                parms[10].Value = item.NORP;
                parms[11].Value = item.NORC;
                parms[12].Value = item.BORE;
                parms[13].Value = item.AORI;
                parms[14].Value = item.SETTLEMENT_TYPE;
                parms[15].Value = item.DORF;
                parms[16].Value = item.ORDER_QTTY;
                parms[17].Value = item.ORDER_PRICE;
                parms[18].Value = item.STATUS;
                parms[19].Value = item.QUOTE_PRICE;
                parms[20].Value = item.QUOTE_TIME;
                parms[21].Value = item.QUOTE_QTTY;
                parms[22].Value = item.ACCOUNT_NO;
                parms[23].Value = item.BROKER_ID;
                parms[24].Value = item.TELEPHONE;
                parms[25].Value = (item.SESSION_NO == null) ? "" : item.SESSION_NO;
                parms[26].Value = item.SETTLE_DAY;
                parms[27].Value = item.AORC;
                parms[28].Value = item.YIELDMAT;
                parms[29].Value = item.CODE_TRADE;



                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Update_STS_STOCKSINFO_BYCODE, parms);
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_TRADING_RESULT()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_TRADING_RESULT));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_TRADING_RESULT()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, DELETE_STS_TRADING_RESULT);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_TRADING_RESULT(STS_TRADING_RESULT item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                        new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_CONFIRM_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_B_ORDER_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_B_ORDER_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_S_ORDER_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_S_ORDER_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_B_NEXT_CNFRM,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_S_NEXT_CNFRM,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_MATCH_TIME,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_MATCH_DATE,MySqlDbType.DateTime),
                        new MySqlParameter( PARM_B_TRADING_ID,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_S_TRADING_ID,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_B_CODE_TRADE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_S_CODE_TRADE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_STATUS,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SEC_CODE,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_QUANTITY,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_PRICE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_B_ACCOUNT_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_S_ACCOUNT_NO,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_SETT_TYPE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_SETT_DATE,MySqlDbType.Decimal),
                        new MySqlParameter( PARM_B_PC_FLAG,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_S_PC_FLAG,MySqlDbType.VarChar),
                        new MySqlParameter( PARM_NORP,MySqlDbType.Decimal)

                };

                parms[0].Value = item.FLOOR_CODE;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.CONFIRM_NO;
                parms[3].Value = item.B_ORDER_NO;
                parms[4].Value = item.B_ORDER_DATE;
                parms[5].Value = item.S_ORDER_NO;
                parms[6].Value = item.S_ORDER_DATE;
                parms[7].Value = item.B_NEXT_CNFRM;
                parms[8].Value = item.S_NEXT_CNFRM;
                parms[9].Value = item.MATCH_TIME;
                parms[10].Value = item.MATCH_DATE;
                parms[11].Value = item.B_TRADING_ID;
                parms[12].Value = item.S_TRADING_ID;
                parms[13].Value = item.B_CODE_TRADE;
                parms[14].Value = item.S_CODE_TRADE;
                parms[15].Value = item.STATUS;
                parms[16].Value = item.SEC_CODE;
                parms[17].Value = item.QUANTITY;
                parms[18].Value = item.PRICE;
                parms[19].Value = item.B_ACCOUNT_NO;
                parms[20].Value = item.S_ACCOUNT_NO;
                parms[21].Value = item.SETT_TYPE;
                parms[22].Value = item.SETT_DATE;
                parms[23].Value = item.B_PC_FLAG;
                parms[24].Value = item.S_PC_FLAG;
                parms[25].Value = item.NORP;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_TRADING_RESULT, parms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void UpdateSTS_TRADING_RESULT(STS_TRADING_RESULT item)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                new MySqlParameter( PARM_FLOOR_CODE,MySqlDbType.VarChar),
                new MySqlParameter( PARM_TRADING_DATE,MySqlDbType.DateTime),
                new MySqlParameter( PARM_CONFIRM_NO,MySqlDbType.VarChar),
                new MySqlParameter( PARM_B_ORDER_NO,MySqlDbType.VarChar),
                new MySqlParameter( PARM_B_ORDER_DATE,MySqlDbType.DateTime),
                new MySqlParameter( PARM_S_ORDER_NO,MySqlDbType.VarChar),
                new MySqlParameter( PARM_S_ORDER_DATE,MySqlDbType.DateTime),
                new MySqlParameter( PARM_B_NEXT_CNFRM,MySqlDbType.Decimal),
                new MySqlParameter( PARM_S_NEXT_CNFRM,MySqlDbType.Decimal),
                new MySqlParameter( PARM_MATCH_TIME,MySqlDbType.VarChar),
                new MySqlParameter( PARM_MATCH_DATE,MySqlDbType.DateTime),
                new MySqlParameter( PARM_B_TRADING_ID,MySqlDbType.Decimal),
                new MySqlParameter( PARM_S_TRADING_ID,MySqlDbType.Decimal),
                new MySqlParameter( PARM_B_CODE_TRADE,MySqlDbType.VarChar),
                new MySqlParameter( PARM_S_CODE_TRADE,MySqlDbType.VarChar),
                new MySqlParameter( PARM_STATUS,MySqlDbType.Decimal),
                new MySqlParameter( PARM_SEC_CODE,MySqlDbType.Decimal),
                new MySqlParameter( PARM_QUANTITY,MySqlDbType.Decimal),
                new MySqlParameter( PARM_PRICE,MySqlDbType.Decimal),
                new MySqlParameter( PARM_B_ACCOUNT_NO,MySqlDbType.VarChar),
                new MySqlParameter( PARM_S_ACCOUNT_NO,MySqlDbType.VarChar),
                new MySqlParameter( PARM_SETT_TYPE,MySqlDbType.Decimal),
                new MySqlParameter( PARM_SETT_DATE,MySqlDbType.Decimal),
                new MySqlParameter( PARM_B_PC_FLAG,MySqlDbType.VarChar),
                new MySqlParameter( PARM_S_PC_FLAG,MySqlDbType.VarChar),
                new MySqlParameter( PARM_NORP,MySqlDbType.Decimal)

                };

                parms[0].Value = item.FLOOR_CODE;
                parms[1].Value = item.TRADING_DATE;
                parms[2].Value = item.CONFIRM_NO;
                parms[3].Value = item.B_ORDER_NO;
                parms[4].Value = item.B_ORDER_DATE;
                parms[5].Value = item.S_ORDER_NO;
                parms[6].Value = item.S_ORDER_DATE;
                parms[7].Value = item.B_NEXT_CNFRM;
                parms[8].Value = item.S_NEXT_CNFRM;
                parms[9].Value = item.MATCH_TIME;
                parms[10].Value = item.MATCH_DATE;
                parms[11].Value = item.B_TRADING_ID;
                parms[12].Value = item.S_TRADING_ID;
                parms[13].Value = item.B_CODE_TRADE;
                parms[14].Value = item.S_CODE_TRADE;
                parms[15].Value = item.STATUS;
                parms[16].Value = item.SEC_CODE;
                parms[17].Value = item.QUANTITY;
                parms[18].Value = item.PRICE;
                parms[19].Value = item.B_ACCOUNT_NO;
                parms[20].Value = item.S_ACCOUNT_NO;
                parms[21].Value = item.SETT_TYPE;
                parms[22].Value = item.SETT_DATE;
                parms[23].Value = item.B_PC_FLAG;
                parms[24].Value = item.S_PC_FLAG;
                parms[25].Value = item.NORP;


                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Update_STS_MARKETINFO, parms);
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_LE_ByCode(string code, decimal totalqtty)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                    new MySqlParameter(PARM_CODE, MySqlDbType.VarChar),
                    new MySqlParameter(PARM_TOTAL_TRADING_QTTY, MySqlDbType.Decimal)
                };

                parms[0].Value = code;
                parms[1].Value = totalqtty;

                return Convert.ToInt32(MyHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_LE_BYCODE, parms));
            }
            catch
            {
                throw;
            }
        }

        public int CountSTS_LE()
        {
            try
            {
                return Convert.ToInt32(MyHelper.ExecuteScalarNoParm(_internalConnection, _internalADOTransaction, CommandType.Text, Count_STS_LE));
            }
            catch
            {
                throw;
            }
        }

        public void DeleteSTS_LE()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, DELETE_STS_LE);
            }
            catch
            {
                throw;
            }
        }

        public void InsertSTS_LE(DateTime time, string code, decimal stockid, decimal price, decimal quantity, decimal high, decimal low, decimal total)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                    new MySqlParameter(PARM_TIME, MySqlDbType.Timestamp),
                    new MySqlParameter(PARM_CODE, MySqlDbType.VarChar),
                    new MySqlParameter(PARM_STOCK_ID, MySqlDbType.Decimal),
                    new MySqlParameter(PARM_PRICE, MySqlDbType.Decimal),
                    new MySqlParameter(PARM_QUANTITY , MySqlDbType.Decimal),
                    new MySqlParameter(PARM_HIGHEST_PRICE, MySqlDbType.Decimal),
                    new MySqlParameter(PARM_LOWEST_PRICE, MySqlDbType.Decimal),
                    new MySqlParameter(PARM_TOTAL_TRADING_QTTY, MySqlDbType.Decimal)
                };

                parms[0].Value = time;
                parms[1].Value = code;
                parms[2].Value = stockid;
                parms[3].Value = price;
                parms[4].Value = quantity;
                parms[5].Value = high;
                parms[6].Value = low;
                parms[7].Value = total;

                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_STS_LE, parms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        #endregion

        /// <summary>
        /// Works on transaction date only
        /// </summary>
        public void BackupHastc()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Delete_BackupHastcOrders);
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_BackupHastcOrders);

            }
            catch
            {
                throw;
            }
        }
        public void ClearHastc()
        {
            try
            {
                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Delete_HastcOrders);
            }
            catch
            {
                throw;
            }
        }

        public void UpdateSecuritiesInfo(int stockno, string symbol, string market)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                                                new MySqlParameter("@STOCKNO", MySqlDbType.Int32),
                                                new MySqlParameter("@STOCKSYMBOL", MySqlDbType.VarChar),
                                                new MySqlParameter("@MARKET", MySqlDbType.VarChar)};
                parms[0].Value = stockno;
                parms[1].Value = symbol;
                parms[2].Value = market;

                MyHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, Insert_SecuritiesInfo, parms);
            }
            catch
            {
                throw;
            }
        }

        #region IStsStocks Members


        public List<STSORDERS> getSTS_ORDERS()
        {
            try
            {
                List<STSORDERS> list = new List<STSORDERS>();
                MySqlDataReader rdr = MyHelper.ExecuteReaderNoParm(_internalConnection, _internalADOTransaction, CommandType.Text, Select_Orders);
                while (rdr.Read())
                {
                    list.Add(new STSORDERS(
                        rdr["FLOOR_CODE"].ToString(),
                        rdr["ORDER_NO"].ToString(),
                        Convert.ToDateTime(rdr["ORDER_DATE"]),
                        rdr["ORDER_TIME"].ToString(),
                        Convert.ToDecimal(rdr["Member_id"]),
                        Convert.ToDecimal(rdr["account_id"]),
                        Convert.ToDecimal(rdr["stock_id"]),
                        Convert.ToDecimal(rdr["order_type"]),
                        Convert.ToDecimal(rdr["priority"]),
                        Convert.ToDecimal(rdr["oorb"]),
                        Convert.ToDecimal(rdr["norp"]),
                        Convert.ToDecimal(rdr["norc"]),
                        Convert.ToDecimal(rdr["bore"]),
                        Convert.ToDecimal(rdr["aori"]),
                        Convert.ToDecimal(rdr["SETTLEMENT_TYPE"]),
                        Convert.ToDecimal(rdr["DORF"]),
                        Convert.ToDecimal(rdr["ORDER_QTTY"]),
                        Convert.ToDecimal(rdr["ORDER_PRICE"]),
                        Convert.ToDecimal(rdr["STATUS"]),
                        Convert.ToDecimal(rdr["QUOTE_PRICE"]),
                        Convert.ToDecimal(rdr["QUOTE_TIME"]),
                        Convert.ToDecimal(rdr["QUOTE_QTTY"]),
                        rdr["ACCOUNT_NO"].ToString(),
                        Convert.ToDecimal(rdr["BROKER_ID"]),
                        Convert.ToDecimal(rdr["TELEPHONE"]),
                        rdr["SESSION_NO"].ToString(),
                        Convert.ToDecimal(rdr["SETTLE_DAY"]),
                        Convert.ToDecimal(rdr["AORC"]),
                        Convert.ToDecimal(rdr["YIELDMAT"]),
                        rdr["CODE_TRADE"].ToString()));
                }
                rdr.Close();
                return list;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }

        public List<STSTRADING_RESULT> getSTS_TRADING_RESULT()
        {
            try
            {
                List<STSTRADING_RESULT> list = new List<STSTRADING_RESULT>();
                MySqlDataReader rdr = MyHelper.ExecuteReaderNoParm(_internalConnection, _internalADOTransaction, CommandType.Text, Select_TradingResult);
                while (rdr.Read())
                {
                    list.Add(new STSTRADING_RESULT(
                        rdr["FLOOR_CODE"].ToString(),
                        Convert.ToDateTime(rdr["TRADING_DATE"]),
                        rdr["CONFIRM_NO"].ToString(),
                        rdr["B_ORDER_NO"].ToString(),
                        Convert.ToDateTime(rdr["B_ORDER_DATE"]),
                        rdr["S_ORDER_NO"].ToString(),
                        Convert.ToDateTime(rdr["S_ORDER_DATE"]),
                        Convert.ToDecimal(rdr["B_NEXT_CNFRM"]),
                        Convert.ToDecimal(rdr["S_NEXT_CNFRM"]),
                        rdr["MATCH_TIME"].ToString(),
                        Convert.ToDateTime(rdr["MATCH_DATE"]),
                        Convert.ToDecimal(rdr["B_TRADING_ID"]),
                        Convert.ToDecimal(rdr["S_TRADING_ID"]),
                        rdr["B_CODE_TRADE"].ToString(),
                        rdr["S_CODE_TRADE"].ToString(),
                        Convert.ToDecimal(rdr["STATUS"]),
                        rdr["SEC_CODE"].ToString(),
                        Convert.ToDecimal(rdr["QUANTITY"]),
                        Convert.ToDecimal(rdr["PRICE"]),
                        rdr["B_ACCOUNT_NO"].ToString(),
                        rdr["S_ACCOUNT_NO"].ToString(),
                        Convert.ToDecimal(rdr["SETT_TYPE"]),
                        Convert.ToDecimal(rdr["SETT_DATE"]),
                        rdr["B_PC_FLAG"].ToString(),
                        rdr["S_PC_FLAG"].ToString(),
                        Convert.ToDecimal(rdr["NORP"])));
                }
                rdr.Close();
                return list;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }

        public List<SecuritiesInfo> getSTOCKSINFO()
        {
            try
            {
                List<SecuritiesInfo> list = new List<SecuritiesInfo>();
                MySqlDataReader rdr = MyHelper.ExecuteReaderNoParm(_internalConnection, _internalADOTransaction, CommandType.Text, Select_StocksInfo);
                while (rdr.Read())
                {
                    list.Add(new SecuritiesInfo(
                        Convert.ToInt32(rdr["STOCKNO"]),
                        rdr["symbol"].ToString(),
                        rdr["stockname"].ToString(),
                        "HASTC"));
                }
                rdr.Close();
                return list;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }

        public List<STSTOP3_PRICE_A> getSTS_TOP3_PRICE_A()
        {
            throw new NotImplementedException();
        }

        public List<STSTOP3_PRICE_B> getSTS_TOP3_PRICE_B()
        {
            throw new NotImplementedException();
        }

        public List<STSMARKETINFO> getSTS_MARKETINFO()
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IStsStocks Backup Members


        public List<STSORDERS> getSTS_ORDERSBackup(DateTime from, DateTime to)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                                                new MySqlParameter(PARM_FROMDATE, MySqlDbType.DateTime),
                                                new MySqlParameter(PARM_TODATE, MySqlDbType.DateTime)};
                parms[0].Value = from;
                parms[1].Value = to;

                List<STSORDERS> list = new List<STSORDERS>();
                MySqlDataReader rdr = MyHelper.ExecuteReader(_internalConnection, _internalADOTransaction, CommandType.Text, Select_Backup_Orders,parms);
                while (rdr.Read())
                {
                    list.Add(new STSORDERS(
                        rdr["FLOOR_CODE"].ToString(),
                        rdr["ORDER_NO"].ToString(),
                        Convert.ToDateTime(rdr["ORDER_DATE"]),
                        rdr["ORDER_TIME"].ToString(),
                        Convert.ToDecimal(rdr["Member_id"]),
                        Convert.ToDecimal(rdr["account_id"]),
                        Convert.ToDecimal(rdr["stock_id"]),
                        Convert.ToDecimal(rdr["order_type"]),
                        Convert.ToDecimal(rdr["priority"]),
                        Convert.ToDecimal(rdr["oorb"]),
                        Convert.ToDecimal(rdr["norp"]),
                        Convert.ToDecimal(rdr["norc"]),
                        Convert.ToDecimal(rdr["bore"]),
                        Convert.ToDecimal(rdr["aori"]),
                        Convert.ToDecimal(rdr["SETTLEMENT_TYPE"]),
                        Convert.ToDecimal(rdr["DORF"]),
                        Convert.ToDecimal(rdr["ORDER_QTTY"]),
                        Convert.ToDecimal(rdr["ORDER_PRICE"]),
                        Convert.ToDecimal(rdr["STATUS"]),
                        Convert.ToDecimal(rdr["QUOTE_PRICE"]),
                        Convert.ToDecimal(rdr["QUOTE_TIME"]),
                        Convert.ToDecimal(rdr["QUOTE_QTTY"]),
                        rdr["ACCOUNT_NO"].ToString(),
                        Convert.ToDecimal(rdr["BROKER_ID"]),
                        Convert.ToDecimal(rdr["TELEPHONE"]),
                        rdr["SESSION_NO"].ToString(),
                        Convert.ToDecimal(rdr["SETTLE_DAY"]),
                        Convert.ToDecimal(rdr["AORC"]),
                        Convert.ToDecimal(rdr["YIELDMAT"]),
                        rdr["CODE_TRADE"].ToString()));
                }
                rdr.Close();
                return list;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }

        public List<STSTRADING_RESULT> getSTS_TRADING_RESULTBackup(DateTime from, DateTime to)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                                                new MySqlParameter(PARM_FROMDATE, MySqlDbType.DateTime),
                                                new MySqlParameter(PARM_TODATE, MySqlDbType.DateTime)};
                parms[0].Value = from;
                parms[1].Value = to;

                List<STSTRADING_RESULT> list = new List<STSTRADING_RESULT>();
                MySqlDataReader rdr = MyHelper.ExecuteReader(_internalConnection, _internalADOTransaction, CommandType.Text, Select_Backup_TradingResult, parms);
                while (rdr.Read())
                {
                    list.Add(new STSTRADING_RESULT(
                        rdr["FLOOR_CODE"].ToString(),
                        Convert.ToDateTime(rdr["TRADING_DATE"]),
                        rdr["CONFIRM_NO"].ToString(),
                        rdr["B_ORDER_NO"].ToString(),
                        Convert.ToDateTime(rdr["B_ORDER_DATE"]),
                        rdr["S_ORDER_NO"].ToString(),
                        Convert.ToDateTime(rdr["S_ORDER_DATE"]),
                        Convert.ToDecimal(rdr["B_NEXT_CNFRM"]),
                        Convert.ToDecimal(rdr["S_NEXT_CNFRM"]),
                        rdr["MATCH_TIME"].ToString(),
                        Convert.ToDateTime(rdr["MATCH_DATE"]),
                        Convert.ToDecimal(rdr["B_TRADING_ID"]),
                        Convert.ToDecimal(rdr["S_TRADING_ID"]),
                        rdr["B_CODE_TRADE"].ToString(),
                        rdr["S_CODE_TRADE"].ToString(),
                        Convert.ToDecimal(rdr["STATUS"]),
                        rdr["SEC_CODE"].ToString(),
                        Convert.ToDecimal(rdr["QUANTITY"]),
                        Convert.ToDecimal(rdr["PRICE"]),
                        rdr["B_ACCOUNT_NO"].ToString(),
                        rdr["S_ACCOUNT_NO"].ToString(),
                        Convert.ToDecimal(rdr["SETT_TYPE"]),
                        Convert.ToDecimal(rdr["SETT_DATE"]),
                        rdr["B_PC_FLAG"].ToString(),
                        rdr["S_PC_FLAG"].ToString(),
                        Convert.ToDecimal(rdr["NORP"])));
                }
                rdr.Close();
                return list;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }

        public List<SecuritiesInfo> getSTOCKSINFOBackup(DateTime from, DateTime to)
        {
            try
            {
                MySqlParameter[] parms = new MySqlParameter[] { 
                                                new MySqlParameter(PARM_FROMDATE, MySqlDbType.DateTime),
                                                new MySqlParameter(PARM_TODATE, MySqlDbType.DateTime)};
                parms[0].Value = from;
                parms[1].Value = to;

                List<SecuritiesInfo> list = new List<SecuritiesInfo>();
                MySqlDataReader rdr = MyHelper.ExecuteReader(_internalConnection, _internalADOTransaction, CommandType.Text, Select_Backup_StocksInfo, parms);
                while (rdr.Read())
                {
                    list.Add(new SecuritiesInfo(
                        Convert.ToInt32(rdr["STOCKNO"]),
                        rdr["symbol"].ToString(),
                        rdr["stockname"].ToString(),
                        "HASTC"));
                }
                rdr.Close();
                return list;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }

        public List<STSTOP3_PRICE_A> getSTS_TOP3_PRICE_ABackup(DateTime from, DateTime to)
        {
            throw new NotImplementedException();
        }

        public List<STSTOP3_PRICE_B> getSTS_TOP3_PRICE_BBackup(DateTime from, DateTime to)
        {
            throw new NotImplementedException();
        }

        public List<STSMARKETINFO> getSTS_MARKETINFOBackup(DateTime from, DateTime to)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
